<?php
require_once("includes/common.php");

pr($_FILES);
$_POST['password'] = md5($_POST['password']);

$_POST['lang'] = implode(',',$_POST['lang']);
$_POST['hobbies'] = implode(',',$_POST['hobbies']);
$_POST['dob'] = date('Y-m-d',strtotime($_POST['dob']));
$_POST['register_date'] = date('Y-m-d h:i:s');
$_POST['status'] = 1;

$source = $_FILES['image']['tmp_name'];
$fileName = date('Ymdhis').'_'.$_FILES['image']['name'];
$dest = "uploads/$fileName";
$_POST['image'] = $fileName;
copy($source, $dest);
//pr($_POST);
////////////////// INSERT INTO DB //////////////
echo $inseredId = insert('users',$_POST);
/////////////////////////////////////////////////

